﻿using System.Collections.Generic;
using com.guojin.core.io;
using com.guojin.core.io.message;

namespace com.guojin.mj.net.message.game
{
    public class PayEmojiReq: Message
    {
        public static int TYPE = 12 ;
        public static int ID =  51 ;

        public int EmojiNum { get; set; } //表情编号
        public int Price { get; set; } //表情价格
        public int SendIndex { get; set; } //发送表情的玩家座位
        public int ReceiveIndex { get; set; } //接受表情的座位

        public void decode(Input _in)
        {
       
        }

        public void encode(Output _out)
        {
            _out.writeInt(EmojiNum);
            _out.writeInt(Price);
            _out.writeInt(SendIndex);
            _out.writeInt(ReceiveIndex);
        }

        public int getMessageId()
        {
            return ID;
        }

        public int getMessageType()
        {
            return TYPE;
        }

        public string toString()
        {
            return string.Format("emojiNum = {0}, price = {1}, sendIndex ={2}, receiveIndex= {3}", EmojiNum, Price, SendIndex, ReceiveIndex);
        }

        public static PayEmojiReq create(int emojiNum, int price, int sendIndex, int receiveIndex)
        {
            var temp = new PayEmojiReq();
            temp.EmojiNum = emojiNum;
            temp.Price = price;
            temp.SendIndex = sendIndex;
            temp.ReceiveIndex = receiveIndex;
            return temp;
        }
    }
}